package com.xmall.sys.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmall.define.base.Result;
import com.xmall.sys.define.dto.operateLog.OperateLogDto;
import com.xmall.sys.define.request.operateLog.OperateLogListPageQueryRequest;
import com.xmall.sys.service.IOperateLogService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 系统字典
 */
@RequestMapping("/service/sys/operateLog")
@RestController
public class OperateLogController {

    @Resource
    private IOperateLogService operateLogService;

    /**
     * 分页列表
     */
    @PreAuthorize("hasAuthority('sys:operateLog:list')")
    @GetMapping("/listPage")
    public Result<Page<OperateLogDto>> listPage(@Validated OperateLogListPageQueryRequest query){
        Page<OperateLogDto> pageList = operateLogService.listPage(query);
        return Result.success(pageList);
    }

}
